<template>
  <RouterView />
</template>
<script lang='ts'>
// import { RouterLink, RouterView } from 'vue-router'
import {ref,onMounted} from 'vue'
import  * as api from "@/api/score";//引入对应的api
import { setToken } from '@/api/auth' // token
export default {
    name: "App",
    setup() {
      onMounted(() => {
        // setToken('存储')
        // 请求接口
        api.GetTestPaperPageList({}).then((res:any) => {
           console.log(res)
        })
      })
      //数据
      let sex = "男"  // 直接赋值的变量并不具备响应式功能
      let name = ref("张三");     //需通过ref定义响应式数据
      let age = ref(18);
      let job = ref({
          name: "前端工程师",
          salary: "30K",
      });
      //方法
      function changeInfo() {
          console.log(sex, name, age)
          sex = "女"  // 修改sex的值页面无法得到实时更新，sex不是响应式的
          name.value = '李四'
          age.value = 48
          console.log(job.value);
          job.value.name = 'UI设计师'
          job.value.salary = '60K'
      }
      //返回一个对象（常用）
      return {
          name,
          age,
          job,
          changeInfo,
      }
    }
}
</script>
<style scoped>
	
</style>
